package com.stool.cloud.service.impl;

import com.stool.cloud.dao.StorageDao;
import com.stool.cloud.service.IStorageService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author Felix YF Dong
 * @Description
 * @Date 2023/2/14
 */
@Slf4j
@Service
public class StorageServiceImpl implements IStorageService {

    @Resource
    private StorageDao storageDao;

    /**
     * 扣减库存
     */
    @Override
    public void decrease(Long productId, Integer count) {
        log.info("------->storage-service中扣减库存开始");
        storageDao.decrease(productId, count);
        log.info("------->storage-service中扣减库存结束");
    }
}
